#ifndef _GINI_H_
#define _GINI_H_
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "glog.h"
#define GINI_LEN_1024 (1024)
#define GINI_LEN_512  (512)
#define GINI_LEN_256  (256)
#define GINI_LEN_128  (128)
#define GINI_LEN_64   (64)
#define GINI_LEN_32   (32)


typedef struct _GList{
   void * data;
   struct _GList * prev;
   struct _GList * next;
}GList;

typedef struct _GItem{
    char *key;
    char *value;
}GItem;

typedef struct _GSection{
        char *name;
       GList *leaf;
}GSection;

typedef struct _GINI{
    char  *filename;
    GList *trunk;
}GIni;

void   gini_parse(FILE *fp_ini,GIni *tree);
GIni*  gini_New(char *pathname);
char * gini_getString(GIni * tree,char * section,char * key);
int    gini_getInt(GIni * tree,char * section,char * key,int default_value);
float  gini_getFloat(GIni * tree,char * section,char * key,float default_value);
void   gini_setString(GIni * tree,char * section,char * key,char * value);
#endif
